import sys

from pygame import display
from main.Over import Over
from main.game import Game
from main.Menu import Menu
from main.LoadScreen import LoadScreen
from main.snake import Snake
from main import clinet, setup

sys.path.insert(0, ".")

import os
import os.path


def main():
    # 当前界面状态 菜单 -> 加载 -> 游戏 -> 结束
    clinet = setup.clinet
    state_dict = {
        "main_menu": Menu(),
        "load_screen": LoadScreen(clinet),
        "snake": Snake(clinet),
        "over": Over()
    }
    game = Game(state_dict, "main_menu")  # 初始化界面状态
    game.run()


if __name__ == "__main__":

    main()
